<template>
	<view class="content">
		<view class="text-area">
			<text class="title" v-for="item in list" @tap="openPage(item.name, item.type)">{{item.name}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				list: [{
						name: '音标专练',
						type: '',
					},{
						name: '听说',
						type: '',
					},
					{
						name: '听力',
						type: '',
					},
					{
						name: '跟读',
						type: '',
					},
					{
						name: '笔试',
						type: '',
					},
					{
						name: '音标',
						type: '',
					},
					{
						name: '典范',
						type: '',
					},
					{
						name: '新概念',
						type: '',
					},
					{
						name: '黑布林',
						type: '',
					},
					{
						name: '趣味',
						type: '',
					},
					{
						name: '看一看',
						type: 'video',
					},
					{
						name: '作业',
						type: 'work',
					},
				],
			}
		},
		// onLoad() {
		// 	var token = uni.getStorageSync('token'); ///从本地缓存中同步移除指定key的数据。
		// 	console.log(token)
		// 	if (token != null && token != '') {
		// 		console.log(111)

		// 	} else {
		// 		uni.reLaunch({
		// 			url: '/pages/login/login'
		// 		});
		// 	}
		// },
		methods: {
			// nianji() {


			// 	that.$post('grade_t').then(res => {
			// 		if (res.code != 0) {
			// 			console.log(res, 11111)						
			// 		} else {
			// 			console.log(res)
			// 			uni.showToast({
			// 				title: res.msg,
			// 				icon: 'none',
			// 				duration: 2000
			// 			});
			// 		}


			// 	})
			// },
			openPage(title, type) {
				if(title=='音标专练'){
					uni.navigateTo({
						url: `/pages/phoneticPractice/list`,
					});
				}else{
					
				uni.navigateTo({
					url: `/pages/listen/index?title=${title}`,
				});
				}
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		flex-wrap: wrap;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
		margin-right: 20px;
	}
</style>
